3.9.2.3 Gear Shift
As part
of a demo from the MathWorks that uses Simulink to model an automotive
drivetrain, its Stateflow diagram as displayed in the following enhances the
Simulink model by capturing the transmission control logic. The diagram contains
two parallel states, gear_state and selection_state.
gear_state consists of four exclusive states that indicate the gear
status respectively, and the transition between them is guarded by events
UP and DOWN. selection_state determines the
direct broadcast of events UP and DOWN, according to the speed value
and thresholds down_th and up_th. In addition, the broadcast is
also restricted by some real-time constraints; for example, the transition that
broadcasts event DOWN to state gear (denoted by
{gear.DOWN}) is constrained by the temporal constraint
after(TWAIT, tick) that checks if state downshifting has been
active for at least TWAIT (a constant) period.
Our
translated PAT model of this Stateflow diagram is available here.
We precisely and concisely capture several Stateflow modeling features possessed
in this diagram, such as deterministic execution order between parallel states
and between multiple outgoing transitions from the same source state, (direct)
event broadcast, and temporal constraints.
Copyright © 2007-2012 Semantic Engineering Pte. Ltd.